-- card: 6308 from stack: in.5 -- bmap block id: 7915 -- flags: 0000 -- background id: 3858 -- name: AUXisRunning ----- HyperTalk script ----- on HideObjects hide cd btn "Try It!" end HideObjects on ShowObjects show cd btn "Try It!" end ShowObjects -- part 1 (button) -- low flags: 00 -- high flags: A002 -- rect: left=78 top=197 right=231 bottom=171 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 8192 -- line height: 16 -- part name: Try it! ----- HyperTalk script ----- on mouseUp if AUXIsRunning() then put "is" into isItRunning else put "is not" into isItRunning answer "A/UX" && isItRunning && "running." end mouseUp -- part contents for background part 20 ----- text ----- Indicates whether A/UX (Apple's UNIX operating system) is currently running or not. This information is especially useful for code which won't work under one operating system or another. For instance A/UX uses the slash "/" as the directory separator in path names whereas Mac OS uses the colon":". Returns "TRUE" or "FALSE". Calling Syntax: AUXIsRunning() -- part contents for background part 38 ----- text ----- 5/50 -- part contents for background part 42 ----- text ----- { AUXIsRunning() } { XFCN returns true or false, reporting whether A/UX is } { running or not. } { © Apple Computer, 1989, 1990. All rights reserved. } { written by Anup Murarka } {} { brought to you by: Anup Murarka Eric Carlson } { ALINK: SKEPTIC ALINK: cyNic } { CIS: 76004,3356 } {} { We are part of the Support Tools Development Group, } { Apple Computer, Inc. } {} { please DO NOT contack Mac DTS for support of this code! } {} { please DO contact the authors for support of this code! } {} { Send comments, bug reports, requests to any of the above } { E-mail addresses or to:} {} { (one of us) } { Apple Computer, Inc. } { 900 E. Hamilton, Ave. } { Campbell, CA 95008 } { M/S 72-L } {} { modification history } { Date Initials Comments } { ---- ------ ------------------------------------------------------} { 2/14/90 akm first written } {} unit AUXIsRunning; interface uses XCmdIntf, XCMDUtils; procedure MAIN (paramPtr: XCmdPtr); implementation procedure AUXisRunning (paramPtr: XCmdPtr); FORWARD; procedure MAIN (paramPtr: XCmdPtr); begin AUXisRunning(paramPtr); end; function BitTest (AddressToCheck: ptr; TotalBits: integer; BitToTest: longint): boolean; { function that allows caller to use std. 68000 bit notation instead of the Toolbox's reversed notation} { example: bit 0 (the least significant bit) in a byte is bit 7 in the Toolbox's notation} begin BitTest := BitTst(AddressToCheck, TotalBits - 1 - BitToTest); end; function AskedForHelp (paramPtr: XCmdPtr; syntaxMsg: Str255; copyRightMsg: Str255): boolean; {} { check to see if the user sent a '?' or a '!' as } { the only parameter. if so we will respond with } { the calling syntax or the copyright/version info } { for this external } {} var firstStr: str255; begin askedForHelp := false; if paramPtr^.paramCount = 1 then begin ZeroToPas(paramPtr, paramPtr^.params[1]^, firstStr); { what is the first param? } if firstStr = '?' then begin paramPtr^.returnValue := PasToZero(paramPtr, syntaxMsg); askedForHelp := true end { asked for help } else if firstStr = '!' then begin paramPtr^.returnValue := PasToZero(paramPtr, copyRightMsg); askedForHelp := true end; { asked for copyright info } end; { one parameter passed } end; { function } procedure AUXisRunning (paramPtr: XCmdPtr); { if A/UX is currently active bit nine of the long at $B22 (2850) is set } { if Mac OS is running, the bit is clear } const HWCfgFlag = $0B22; begin if not askedForHelp(paramPtr, 'AUXIsRunning()', 'v1.0, ©1989, 1990 Apple Computer, Inc., Anup Murarka') then paramPtr^.returnValue := PasToZero(paramPtr, BoolToStr(paramPtr, BitTest(pointer(HWCfgFlag), 16, 9))); end; end.